package com.crazypos.security.entity;

import com.crazypos.pojo.vo.RoleMenuVO;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

@Data
public class UserDetailEntity implements UserDetails {

    private String id;

    private String username;

    private String password;

    private String status;

    private String organizationId;

    private String roleId;

    private String roleName;

    private List<RoleMenuVO> navMenus;

    private List<RoleMenuVO> roleMenus;

    private List<String> permissions;

    private String type;

    // 用户权限
    private Collection<GrantedAuthority> authorities;

    /**
     * 账户是否过期
     */
    private boolean isAccountNonExpired = false;
    /**
     * 账户是否被锁定
     */
    private boolean isAccountNonLocked = false;
    /**
     * 证书是否过期
     */
    private boolean isCredentialsNonExpired = false;
    /**
     * 账户是否有效
     */
    private boolean isEnabled = true;
}
